summaryrefslogtreecommitdiff
path: root/app/[lng]/partners/pq/page.tsx
blob: 8ad23f6e417b82b682a4e570b223525cf7c25bd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { getServerSession } from "next-auth"
import { authOptions } from "@/app/api/auth/[...nextauth]/route"
import * as React from "react"
import { Shell } from "@/components/shell"
import { Skeleton } from "@/components/ui/skeleton"
import { getPQDataByVendorId } from "@/lib/pq/service"
import { PQInputTabs } from "@/components/pq/pq-input-tabs"


export default async function PQInputPage() {
  // 세션
  const session = await getServerSession(authOptions)
  // 예: 세션에서 vendorId 가져오기
  // const vendorId = session?.user.companyId
  const vendorId = 17 // 임시
  const idAsNumber = Number(vendorId)

  // 1) 서버에서 PQ 데이터 조회 (groupName별로 묶인 구조)
  const pqData = await getPQDataByVendorId(idAsNumber)

  return (
    <Shell className="gap-2">
      <div className="space-y-2">
        <h2 className="text-2xl font-bold tracking-tight">
          Pre-Qualification Check Sheet
        </h2>
        <p className="text-muted-foreground">
          PQ에 적절한 응답을 제출하시기 바랍니다. 진행 중 문의가 있으면 담당자에게 연락바랍니다.
        </p>
      </div>

      {/* 클라이언트 탭 UI 로드 (Suspense는 여기서는 크게 필요치 않을 수도 있음) */}
      <React.Suspense fallback={<Skeleton className="h-7 w-52" />}>
        <PQInputTabs data={pqData} vendorId={idAsNumber} />
      </React.Suspense>

    </Shell>
  )
}